import axios from 'poros/http';

// const BASE_API = 'http://10.110.100.171:8030';
const BASE_API = '';

// 潜客维护列表搜索接口
export const postCustomerFormalByPage = data =>
  axios({
    url: `${BASE_API}/api/salesforecast-service/customerFormal/customerFormalListByPage`,
    method: 'post',
    data,
  });

// 潜客维护列表导出接口
export const postCustomerMainExport = data =>
  axios({
    url: `${BASE_API}/api/salesforecast-service/customerFormal/export`,
    method: 'post',
    responseType: 'arraybuffer',
    hasInterceptors: true,
    data,
  });

// 潜客维护基本信息接口
export const getCustomerMainDetail = id =>
  axios({
    url: `${BASE_API}/api/salesforecast-service/customerFormal/query/${id}`,
    method: 'get',
  });

// 潜客维护转正式客户接口
export const postCustomerMainUpdate = data =>
  axios({
    url: `${BASE_API}/api/salesforecast-service/customerFormal/batchUpdate`,
    method: 'post',
    data,
  });

//  潜客维护保存接口
export const postSaveCustomerFormal = data =>
  axios({
    url: `${BASE_API}/api/salesforecast-service/customerFormal/update`,
    // url: 'http://10.110.100.171:8030/api/salesforecast-service/customer/launchCustomerCreate',
    method: 'post',
    data,
  });

//  潜客维护客户名称、客户简称是否重复接口
export const postInspectionMainRepeat = data =>
  axios({
    url: `${BASE_API}/api/salesforecast-service/customerFormal/inspectionRepeat`,
    method: 'post',
    data,
  });

export const getRelationList = params =>
  axios({
    url: `${BASE_API}/api/salesforecast-service/customer/queryRelationshipDecision`,
    method: 'get',
    params,
  });
